import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent} from './login/login.component';
import { MasterHomeComponent} from './master-home/master-home.component';
import { ReaderHomeComponent} from './reader-home/reader-home.component';
import { AddComponent} from './add-book/add.component';
import { DeleteBookComponent} from './delete-book/delete-book.component';
import { SearchBookComponent} from './search-book/search-book.component';
import { RecordCheckComponent} from './record-check/record-check.component';
import { ReturnComponent} from './return/return.component';
import { NewReaderComponent} from './new-reader/new-reader.component';
import { SecondLendComponent} from './second-lend/second-lend.component';

const routes: Routes = [
  { path: '', redirectTo: '/login', pathMatch: 'full'},
  { path: 'login', component: LoginComponent},
  { path: 'login/master', component: MasterHomeComponent},
  { path: 'login/reader', component: ReaderHomeComponent},
  { path: 'login/master/add',  component: AddComponent},
  { path: 'login/master/search', component: SearchBookComponent},
  { path: 'login/master/records', component: RecordCheckComponent},
  { path: 'login/reader/return', component: ReturnComponent},
  { path: 'login/master/delete', component: DeleteBookComponent},
  { path: 'login/register', component: NewReaderComponent},
  { path: 'login/reader/secondlend', component: SecondLendComponent},
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
